/*--------------------------------------------------------------
 * File: demo26.c 编码类型：C语言  UTF-8
 * Author WRS (1352509846@qq.com)
 * 功能: 一个正整数的阶乘，是所有小于及等于该正整数的及，并且0的阶乘为1，
 * 自然数的阶乘写作n!
 * Version 0.1
 * Date 2022-01-22 
 * 
 * @copyright Copyright (c) 2022
 * 
----------------------------------------------------------------*/
#include <stdio.h>

int multiplyNumbers(int n)
{
    if(n >= 1)
        return n*multiplyNumbers(n-1);
    else
        return 1;
}

int main(int argc, char const *argv[])
{
    int n;
    int factorial = 1;
    printf("请输入一个要求阶乘的整数：");
    scanf("%d",&n);
    printf("%d! = %d\n",n,multiplyNumbers(n));
    return 0;
}
